import CodeBlock from "@theme/CodeBlock";
import CallbacksExample from "@examples/agents/agent_callbacks.ts";

# Subscribing to events

You can subscribe to a number of events that are emitted by the Agent and the underlying tools, chains and models via callbacks.

For more info on the events available see the [Callbacks](/docs/modules/callbacks/) section of the docs.

import IntegrationInstallTooltip from "@mdx_components/integration_install_tooltip.mdx";

<IntegrationInstallTooltip></IntegrationInstallTooltip>

```bash npm2yarn
npm install @langchain/openai
```

<CodeBlock language="typescript">{CallbacksExample}</CodeBlock>
